package com.jisf.driver.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * @Classname KafkaUtil
 * @Description TODO
 * @Date 2022/5/19 3:14
 * @Created by jisf：【429627912@qq.com】
 */
@Component
public class KafkaUtil {

    @Autowired
    KafkaTemplate<String, String> kafka;

    @Value("${spring.kafka.topic}")
    private String topic;

    public void producerLogInfo(String msg){
        kafka.send(topic, msg);
    }

    public void producerLogErr(String msg){
        kafka.send(topic, msg);
    }

}
